import { configureStore } from '@reduxjs/toolkit';
import userReducer from './userSlice';
import React from 'react';

export const store = configureStore({
  reducer: {
    user: userReducer,
  },
});

// 从store本身推断出 `RootState` 类型
export type RootState = ReturnType<typeof store.getState>;
// 推断出 dispatch 类型
export type AppDispatch = typeof store.dispatch;

/**
 * 空组件，仅用于解决Expo Router警告
 * Expo Router要求每个可路由文件导出一个默认的React组件
 */
export default function StoreComponent() {
  return React.createElement(React.Fragment);
} 